<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.model.User"%>

<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>
<div class="position">
	<img src="../images/position2.jpg" style="padding: 7px 9px; float: left;" />当前位置：上海高桥分公司问题管理平台 &gt;&gt; 系统管理&gt;&gt; 岗检标准管理
</div>

<%
{
%>
<div class="tt">岗检标准管理</div>
<div class="content">
	<table align="center" border="0" width="700" cellpadding="0"
		cellspacing="0">
		<tr>
			<td class="td1" height="35" style="padding-bottom:5px;">
				<span style="margin-left: 30px">岗检：</span>
				<span id="postcheckSelectSpan">
				<%@include file="postcheck_select/postcheck_select_section.jsp" %>
				</span>
				<br />
				<span style="margin-left: 30px">检查方式：</span>
				<span id="patternSelectSpan">
				<%@include file="postcheck_select/pattern_select_section.jsp" %>
				</span>
				<br />
				<span style="margin-left: 30px">工作内容：</span>
				<span id="contentSelectSpan">
				<%@include file="postcheck_select/content_select_section.jsp" %>
				</span>
			</td>			
		</tr>
		<tr>
			<td class="td1" align="left" style="padding-top:5px;">
				<label>工作标准：</label> <a href="javascript:addPostcheckStandard()">添加</a>
				<span id="standardListSpan">
				<%@include file="postcheck_standard_list.jsp" %>
				</span>
			</td>
		</tr>
		
	</table>
</div>
<script type="text/javascript">
function selectPostcheck() {
	var postcheckID = getElementValueByID('postcheck');	
	loadPageSection('postcheck_select/pattern_select_section.jsp', 'patternSelectSpan', {postcheckID:postcheckID}, false, function(){ selectPattern();});
}

function selectPattern() {
	var postcheckID = getElementValueByID('postcheck');
	var postcheckPatternID = getElementValueByID('postcheckPattern');
	loadPageSection('postcheck_select/content_select_section.jsp', 'contentSelectSpan', {postcheckID:postcheckID, postcheckPatternID:postcheckPatternID}, false, function(){selectContent();});
}

function selectContent() {
	var postcheckContentID = getElementValueByID('postcheckContent');
	loadPageSection('postcheck_standard_list.jsp', 'standardListSpan', {postcheckContentID: postcheckContentID}, false);
}

function addPostcheckStandard() {
	var postcheckID = getElementValueByID('postcheck');
	var posthcheckName = $("select[@id='postcheck'] option[@selected]").text();
	var postcheckPatternID = getElementValueByID('postcheckPattern');
	var postcheckPattern = $("select[@id='postcheckPattern'] option[@selected]").text();
	var postcheckContentID = getElementValueByID('postcheckContent');
	var postcheckContent = $("select[@id='postcheckContent'] option[@selected]").text();
	loadPageSection(
		'add_postcheck_standard.jsp', 
		'mainContentDiv', {
			postcheckID: postcheckID,
			postcheckName: posthcheckName,  
			postcheckPatternID: postcheckPatternID,
			postcheckPattern: postcheckPattern, 
			postcheckContentID: postcheckContentID,
			postcheckContent: postcheckContent
		}, 
		false);
}

function deletePostcheckStandard(postcheckStandardID){
	if(postcheckStandardID== null || postcheckStandardID == ''){
		return;
	}
	
	var postcheckID = getElementValueByID('postcheck');
	var postcheckPatternID = getElementValueByID('postcheckPattern');
	var postcheckContentID = getElementValueByID('postcheckContent');
	
	$.dialog.confirm('您确认删除该条岗检标准吗？该标准删除后将不可恢复！',function(){
		openWaitingDialog('waitingDialog');
		$.ajax({
			type:'post',
			url:'delete_postcheck_standard_process.jsp',
			data:{			
				postcheckStandardID: postcheckStandardID
			},
			success:function(data,state,xmlhttp){
				var obj = null;
				try {
					obj = eval('(' + data + ')');
				} catch (e) {
				}
				if (typeof(obj.isSuccess) != 'undefined') {
					closeWaitingDialog('waitingDialog');
					if (obj.isSuccess == 'true') {					
						$.dialog('删除成功！', function() { 
							loadPageSection(
								'postcheck.jsp', 
								'mainContentDiv', 
								{
									postcheckID: postcheckID, 
									postcheckPatternID: postcheckPatternID,
									postcheckContentID: postcheckContentID
								}, 
								true
							); 
						});					
					} else {
						$.dialog.alert(obj.error);
					}
				}
			}
		});		
	});
}

function  gotoUpdatePostcheckStandard(postcheckStandardID){
	var postcheckID = getElementValueByID('postcheck');
	var posthcheckName = $("select[@id='postcheck'] option[@selected]").text();
	var postcheckPatternID = getElementValueByID('postcheckPattern');
	var postcheckPattern = $("select[@id='postcheckPattern'] option[@selected]").text();
	var postcheckContentID = getElementValueByID('postcheckContent');
	var postcheckContent = $("select[@id='postcheckContent'] option[@selected]").text();
	loadPageSection(
		'update_postcheck_standard.jsp', 
		'mainContentDiv', {
			postcheckID: postcheckID,
			postcheckName: posthcheckName,  
			postcheckPatternID: postcheckPatternID,
			postcheckPattern: postcheckPattern, 
			postcheckContentID: postcheckContentID,
			postcheckContent: postcheckContent,
			postcheckStandardID: postcheckStandardID
		}, 
		false);
}
</script>
<%
}
%>

